/**
 * Copyright © 2017, Forp Co., LTD
 *
 * All Rights Reserved.
 */
package org.jeecg.common.constant.enums;

public enum FlagEnum {

	/**
	 * 确定
	 */
	YES(1, "是"),

	/**
	 * 否定
	 */
	NO(0, "否");

	private Integer id;
	private String name;

	private FlagEnum(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	public Integer getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public static FlagEnum get(Integer id) {
		if (id == null) {
			return null;
		}
		for (FlagEnum status : values()) {
			if (status.getId().equals(id)) {
				return status;
			}
		}
		return null;
	}
}
